<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta content="black" name="apple-mobile-web-app-status-bar-style"/>
<meta content="telephone=no" name="format-detection"/>
<script src="/js/jquery-1.11.3.js"></script>
<script src="/js/profile.js"></script>
<script src="/js/login.js"></script>
<script src="/js/common.js"></script>
<script src="/js/dialog/jquery.artDialog.js?skin=default"></script>

<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/ionicons.min.css">
<title>淘惠品--淘宝账号</title>
</head>

<body style="background:#f8f8f8">
<div class="fu_header">
	<h1>绑定淘宝</h1>
	<div class="back">
		<a href="javascript:history.go(-1)">
			<i class="icon ion-ios-arrow-back back_icon"></i>
			<b>Back</b>
		</a>
	</div>
</div>
<div class="top_tk"></div>
<div class="edit_user_taobao hang">
	<div class="a1">
		<i class="icon ion-card" style="font-size:18px;color:#f3972b"></i>
		<input type="text" id="tb_info" placeholder="请输入您的淘宝账号">
	</div>
</div>
<div class="clear"></div>
<div class="edit_user_alipay_tip">
	<p>1.绑定淘宝帐号可以提高通过率。</p>
	<p>2.最多绑定3个淘宝账号</p>
</div>
<div class="save bind_tb">
	绑定
</div>
<div class="ybind_taobao">
	<h3>已绑定淘宝</h3>
	<ul class="ybing_tb"></ul>
</div>
</body>
</html><script type="text/javascript">
	var tb_list='';
	$(function(){
		$.ajax(
				{   data:{page:1,userid:myinfo['userid'],random:myinfo['random'],orderway:'desc'},
					type:'get',
					url : myconfig['api']+'get_tbaccount',
					dataType : 'json',
					jsonp:"jsoncallback",
					success  : function(data) {
							for (var j = 0; j < data.lists.length; j++) {
								//tb_list += '<li> '+ data.lists[j].account + '</li>';
								tb_list += '<li>'+ data.lists[j].account + '</li>'
							}
						$('.ybing_tb').html(tb_list);
					},
					error : function() {
						$(".ybing_tb").html("<li>数据加载失败！</li>")
					}
			});
	});
	$(document).ready(function(){
	 $('.ybing_tb').delegate('li','click', function () {
	     var account=$(this).text();
		 if(myinfo['userid'] && myinfo['random']) {
			 var save_name = myconfig['api'] + 'bind_del_tb';
			 var userid = myinfo['userid'];
			 var random = myinfo['random'];
			 $.post(save_name,{userid:userid,random:random,account:account}, function(data,status) {
				 if(data.status==1){
					 art.dialog({
						 lock: true,
						 fixed: true,
						 icon: 'face-smile',
						 title: '提示',
						 content: data.msg,
						 okVal: '确定',
						 ok:function() {

							 window.location.href='/templates/user/profile_taobao.html';
						 }
					 });
				 }else{
					 art.dialog({
						 lock: true,
						 fixed: true,
						 icon: 'face-sad',
						 title: '错误提示',
						 content: data.msg,
						 ok: true

					 });
				 }
			 })
		 }
	 });
	 });
	/*function tb_del(){
		var tbdel= document.documentElementById("tb_del").innerHTML;
		alert(tbdel);

	}*/

	/*window.onload = function(){
		var obj_lis = document.getElementById("ybing_tb").getElementsByTagName("li");
		for(i=0;i<obj_lis.length;i++){
			obj_lis[i].onclick = function(){
				alert(this.innerHTML);
			}
		}
	}*/
</script>